<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../jeasyui/jquery.min.js"></script>
    <script src="../jeasyui/echarts.min.js"></script>
    <script>
        $(function () {
            let myChart = echarts.init(document.getElementById('main1'));
            $.post('../logs/countTimes', function (data) {

                // 指定图表的配置项和数据
                let option = {
                    title: {
                        text: '系统访问数据分析图'
                    },
                    tooltip: {},
                    legend: {
                        data: ['登录次数统计']
                    },
                    xAxis: {
                        data: data.names
                    },
                    yAxis: {},
                    series: [
                        {
                            name: '登录次数',
                            type: 'bar',
                            data: data.times
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            })

            let myChart2 = echarts.init(document.getElementById('main2'));
            $.post('../tags/countTimesTags', function (data) {
                // 指定图表的配置项和数据
                option = {
                    tooltip: {
                        trigger: 'item'
                    },
                    legend: {
                        top: '5%',
                        left: 'center'
                    },
                    series: [
                        {
                            name: '类别下问题数',
                            type: 'pie',
                            radius: ['40%', '70%'],
                            avoidLabelOverlap: false,
                            itemStyle: {
                                borderRadius: 10,
                                borderColor: '#fff',
                                borderWidth: 2
                            },
                            label: {
                                show: false,
                                position: 'center'
                            },
                            emphasis: {
                                label: {
                                    show: true,
                                    fontSize: '40',
                                    fontWeight: 'bold'
                                }
                            },
                            labelLine: {
                                show: false
                            },
                            data: data
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart2.setOption(option);
            })

        })
    </script>
</head>
<body>
<table>
    <tr>
        <td>
            <div id="main1" style="width: 500px;height: 400px;margin-top: 50px;"></div>
        </td>
        <td>
            <div id="main2" style="width: 500px;height: 400px"></div>
        </td>
    </tr>
    <tr>

    </tr>
</table>


</body>
</html>